package com.foreknow.demo12;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class Test2 {
    public static void main(String[] args) {
        List<Integer> list1 = new ArrayList<>();
        Random r = new Random();
        for (int i = 0; i < 10; i++) {
            int x = r.nextInt(100);
            list1.add(x);
        }

        List<Integer> list2 = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            int x = r.nextInt(100);
            list2.add(x);
        }
        System.out.println(list1);
        System.out.println(list2);

        Collections.copy(list2,list1);

        System.out.println(list1);
        System.out.println(list2);
    }
}
